package entity;

//宝宝类
public class Baby {
    //一个宝宝出生时,必须确定亲生母亲和性别
    public Baby(Woman mother,String gender){
        this.mother = mother;
        this.gender = gender;
    }
    //姓名,可以出生后再取名,也可以改名
    private String name;
    //轻声母亲,出生就是确定,后面不会改变
    private Woman mother;
    //性别,出生就可以确定,非特殊情况不会改变
    private String gender;
    public String getName(){return name;}
    public Woman getMother(){return mother;}
    public String getGender(){return gender;}
    //只有名字加setter
    public void setName(String name){this.name = name;}
    public void introduce(){
        System.out.println("我是一个"+getGender()+"宝宝,我的妈妈是:"+this.getMother().getName());
        if(name==null){
            System.out.println("我还没取名呢~");
        }else {
            System.out.println("我叫"+this.getName());
        }
    }
}
